{template 'common/header'}
<title>蓝血贵族VIP卡</title>
<link href="../addons/ewei_shop/plugin/commission/template/mobile/default/static/datepicker/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../addons/ewei_shop/plugin/commission/template/mobile/default/static/datepicker/date.js" ></script>
<script type="text/javascript" src="../addons/ewei_shop/plugin/commission/template/mobile/default/static/datepicker/iscroll.js" ></script>
<script src="../addons/ewei_shop/static/js/dist/ajaxfileupload.js" type="text/javascript"></script>

<link href="{$_W['siteroot']}app/resource/css/bootstrap.min.css?v=20150403" rel="stylesheet">
<link rel="stylesheet" href="../addons/amouse_ecard/style/css/nameCard.css?v=201410256">
<script src="{$_W['siteroot']}app/resource/js/require.js"></script>
<script src="{$_W['siteroot']}app/resource/js/app/config.js"></script>
<script type="text/javascript">
            $(function(){
            $('#starttime').date({theme:"datetime"});
                    $('#overtime').date({theme:"datetime"});
            });
</script>
<style type="text/css">
    body {margin:0px; background:#efefef; font-family:'微软雅黑'; -moz-appearance:none;}
    a {text-decoration:none;}
    .myshop_addnav {height:44px; width:94%; padding:0 3%; border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:14px; line-height:42px; color:#666; background:#fff;}
    .myshop_addnav {height:40px; width:94%; padding:0 3%; border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:14px; line-height:40px; color:#666; }
    .myshop_main {height:auto;width:100%; padding:0px 3%; border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:14px; background:#fff;}
    .myshop_main .line {height:44px; width:100%; border-bottom:1px solid #f0f0f0; line-height:44px;}

    .myshop_main .line .label { float:left;width:75px;font-size:14px;color:#555;line-height:34px;}
    .myshop_main .line .info { float:right; width:100%; margin-left:-75px;text-align: right;overflow:hidden;height:44px;}
    .myshop_main .line .info .inner { color:#666;margin-left:75px;}

    .myshop_main .line1 {height:80px; width:100%; border-bottom:1px solid #f0f0f0; line-height:80px;}
    .myshop_main .line1 .label { float:left;width:70px;color:#555;line-height:34px;}
    .myshop_main .line1 .info { float:right; width:100%; margin-left:-75px;;overflow:hidden;height:80px;}
    .myshop_main .line1 .info .inner { color:#666;margin-left:75px;padding-top:10px;}
    .myshop_main .line1 .info .inner .plus { float:left;width:60px;height:60px;border:1px solid #efefef; color:#efefef;; font-size:45px;line-height:55px;text-align:center;}
    .myshop_main .line1 .info .inner .plus1 { float:left;width:90%;height:60px;border:1px solid #efefef; color:#efefef;; font-size:45px;line-height:55px;text-align:center;}

    .myshop_main .line1 .info .inner .preview0 { position:absolute; width:60px;height:60px;z-index:2}
    .myshop_main .line1 .info .inner .preview1 { position:absolute; width:90%;height:60px;z-index:2}

    .myshop_main .line1 .info .inner .preview0 img,.myshop_main .line1 .info .inner .preview1 img { width:100%;height:100%;}

    .myshop_main .line input {float:left; height:40px; width:100%; padding:0px; margin:0px; border:0px; outline:none; font-size:14px; color:#666;padding-left:5px;}
    .myshop_main .line select  {float:left; border:none;height:44px;width:100%;color:#666;font-size:14px;}
    .myshop_sub1 {height:44px; width:94%; margin:14px 3% 0px; background:#ff4f4f; border-radius:4px; text-align:center; font-size:16px; line-height:44px; color:#fff;}
    .myshop_sub2 {height:44px; width:94%; margin:14px 3% 0px; background:#ddd; border-radius:4px; text-align:center; font-size:16px; line-height:44px; color:#666; border:1px solid #d4d4d4;}

    .myshop_main .line2 {width:100%;  line-height:25px; color:#666;overflow:hidden; font-size:13px;word-break: break-all;}

    textarea {height:60px;line-height:22px; width:100%;padding:5px;font-size:13px; background:#fff; padding-left:2%; border:1px solid #e9e9e9; margin:14px 0px 0; -webkit-appearance: none;} 
    .myshop_menu {height:44px; background:#fff;}
    .myshop_menu .nav {height:44px; width:50%; border-bottom:1px solid #f1f1f1;background:#fff; border-left:1px solid #f1f1f1; float:left; line-height:44px; font-size:14px; color:#666; text-align:center;}
    .myshop_menu .navon {height:42px; color:#ff771b; border-bottom:2px solid #ff771b;}

    .myshop_main .pic { border:1px solid #e9e9e9;width:100%;height:40px;border-radius:5px;color:#999;padding:3px;line-height:35px;font-size:13px;padding-left:10px;}
    .myshop_main .pic span {float:left;width:150px;}
    .myshop_main .pic .plus { float:right;width:30px;height:30px;border:1px solid #e9e9e9; color:#dedede;; font-size:18px;line-height:30px;text-align:center;}
    .myshop_main .pic .plus i { left:7px;top:7px;}
    .myshop_main .pic .images {float: right; width:auto;height:30px;}
    .myshop_main .pic .images .img { float:left; position:relative;width:30px;height:30px;border:1px solid #e9e9e9;margin-right:5px;}
    .myshop_main .pic .images .img img { position:absolute;top:0; width:100%;height:100%;}
    .myshop_main .pic .images .img .minus { position:absolute;color:red;width:8px;height:12px;top:-15px;right:-1px;}
    .info2 {padding:10px;border-bottom:1px solid #eee; border-top:1px solid #eee;}
    .info2 .con {height:auto; padding:10px 0px;}
    .info2 .con .line2 {height:auto; overflow:hidden; margin-bottom:5px;}
    .info2 .con .line2 .t1 {height:auto; width:55px; float:left; font-size:14px; color:#666; line-height:20px;}
    .info2 .con .line2 .t2 {padding-left:0px; background:#f90;}
    .info2 .con .line2 .t2 .t3 {height:auto; float:left; font-size:14px; color:#999;}
    input.inputDate{width:120px;}
    #dateshadow{height:0px;}
    #datePage{top:300px !important;}
    .biaoji {color:red;}
    .fillIn-inner .fillIn-inner-item .fillIn-avatar-thumbnail{background:none;border-radius:0px;-webkit-border-radius:0px;}
    .fillIn-inner .ico-upload{background:url(../addons/amouse_ecard/style/images/upload.jpg) no-repeat;background-size:50px;}
    .suggest{margin-top: 3%;width: 100%;background-color:white;min-height: 70px;font: 14px/24px '微软雅黑';padding-top: 2%}
    textarea{resize:none;}
    select option{text-align: center;}
</style>
<div id='container'></div>
<div class="page_topbar">
    <a href="javascript:;" class="back" onclick="history.go(-1)"><i class="fa fa-angle-left"></i></a>
    <div class="title">蓝血贵族VIP卡活动资格申请</div>
</div>
<div id="datePlugin"></div>
<!-- 提示信息 -->
<div class="suggest">
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>蓝血贵族VIP卡申请简介</b>：必须具有店主身份的用户才能申请，不具有店主身份资格的人无法申请蓝血贵族VIP卡</p>
</div>
{if empty($info) || $info['replay'] ==1 }
<script type="text/javascript" src="../addons/ewei_shop/static/js/dist/area/cascade.js"></script>
<div class="myshop_main" data-ogid='0' >
    <div class="line"><div class="label" >姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名<span style="color:red">*</span></div><div class="info"><div class="inner"><input type="text" id="name" value="" placeholder="请输入姓名"/></div></div></div>
    <div class="line"><div class="label" >手&nbsp;机&nbsp;&nbsp;号<span style="color:red">*</span></div><div class="info"><div class="inner"><input type="text" id="phone" value="" placeholder="请输入手机号码"/></div></div></div>
    <div class="line"><div class="label" >店铺名称<span style="color:red">*</span></div><div class="info"><div class="inner"><input type="text" id="shopname" value="" placeholder="请输入店铺名称"/></div></div></div>
    <div class="line"><div class="label" >店铺地址<span style="color:red">*</span></div><div class="info"><div class="inner"><div id="city_4">
            <select class="prov" name="prov" style="width: 33%;height: 40px" id="prov"></select> 
            <select class="city" disabled="disabled" name="city" style="width: 33%;height: 40px" id="city"></select>
            <select class="dist" disabled="disabled" name="dist" style="width: 33%;height: 40px" id="dist"></select>
    </div></div></div></div>
    <div class="line"><div class="label"></div><div class="info"><div class="inner"><input type="text" id="address" value="" placeholder="详细地址"/></div></div></div>
    <div class="line" style="height: 100px"><div class="label">备注</div><div class="info" style="height: 100px"><div class="inner" style="height: 100px"><textarea id="applyinfo"></textarea></div></div></div>
</div>
<div class="myshop_sub1" id='myshop_submit'>确认</div>
{else}
<div class="myshop_main" data-ogid='0' >
        <div class="line"><div class="label">姓名：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['name']}</div></div></div>
        <div class="line"><div class="label">手机号：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['mobile']}</div></div></div>
        <div class="line"><div class="label">店铺名称：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['shopname']}</div></div></div>
        <div class="line"><div class="label">店铺地址：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['address']}</div></div></div>
        <div class="line"><div class="label">申请时间：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['time_begin']}</div></div></div>
        {if $info['time_end'] != 0}
        <div class="line"><div class="label">审核时间：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['time_end']}</div></div></div>
        {/if}
         {if !empty($info['explain'])}
        <div class="line"><div class="label">审核说明：</div><div class="info" style="text-align: left;font:14px/40px '微软雅黑'"><div class="inner">{$info['explain']}</div></div></div>
        {/if}
        <div class="line"><div class="label">状态：</div><div class="info" style="text-align: left;font:14px/20px '微软雅黑'"><div class="inner">
        {if $info['status']==0}<span class="label label-warning" style="height: 80%">审核中</span>{/if}
        {if $info['status']==1}<span class="label label-success" style="height: 80%">审核通过</span>{/if}
        {if $info['status']==2}<span class="label label-danger">未通过</span>{/if}
        </div></div></div>   
</div>
        {if $info['status']==2}
            <div class="myshop_sub1" id='replay_submit'>重新申请</div>
        {/if}  
{/if}

<script type="text/javascript">
     require(['tpl', 'core'], function(tpl, core){
                $('#myshop_submit').click(function(){
                if ($(this).attr('saving') == '1'){
                    return;
                }
                if ($('#name').isEmpty()){
                    core.tip.show('请输入姓名!');
                    $(this).html('确认').removeAttr('saving');
                    return;
                } 
                if ($('#phone').isEmpty()){
                    core.tip.show('请输入手机号!');
                    $(this).html('确认').removeAttr('saving');
                    return;
                } 
                if ($('#shopname').isEmpty()){
                    core.tip.show('请输入店铺名称!');
                    $(this).html('确认').removeAttr('saving');
                    return;
                }
                if ($('#address').isEmpty()){
                    core.tip.show('请输入详细地址!');
                    $(this).html('确认').removeAttr('saving');
                    return;
                }
                var phone=$('#phone').val();
                if(!(/^1[34578]\d{9}$/.test(phone))){ 
                    alert("手机号码有误，请重填");  
                    return false; 
                }                
                core.json('member/seniority', {
                    op:'infoadd',
                    name:$('#name').val(),
                    mobile: $('#phone').val(),
                    applyinfo:$('#applyinfo').val(),
                    shopname:$('#shopname').val(),
                    address:$('#prov').val()+$('#city').val()+$('#dist').val()+$('#address').val(),
                }, function(postjson){
                if (postjson.status == 1){
                    core.tip.show('申请成功');
                    location.href='{php echo $this->createMobileUrl('member/seniority')}';
                }else{
                        core.tip.show(postjson.result);
                }
                }, true);
                });
                $("#replay_submit").click(function(){
                core.json('member/seniority', {
                    op:'update',
                    id:"{$info['id']}",
                }, function(postjson){
                if (postjson.status == 1){
                    core.tip.show('重新申请成功!');
                    location.href='{php echo $this->createMobileUrl('member/seniority')}';
                }else{
                        core.tip.show(postjson.result);
                }
                }, true);                    
                });
            })
</script>
<script type="text/javascript" src="../addons/ewei_shop/static/js/dist/area/jquery.cityselect.js"></script>
<script type="text/javascript">
$(function(){

    $("#city_4").citySelect({
        url:"../addons/ewei_shop/static/js/dist/area/city.min.js",
        prov:"浙江", 
        city:"杭州",
        dist:"上城区",
        nodata:"none"
    }); 

    
});
</script>
{template 'common/footer'}
